<?php

use think\facade\Route;

// 活动路由
Route::group('activity', function () {
    // 活动规格
    Route::get('activity/skus', 'admin.activity.Activity/skus')->name('admin.activity.Activity.skus');
    // 选择活动
    Route::get('activity/select/:type', 'admin.activity.Activity/select')->name('admin.activity.Activity.select');

    Route::group(function () {
        // 活动
        Route::get('activity/list/:type', 'admin.activity.Activity/list')->name('admin.activity.Activity.list');
        Route::get('activity/recyclebin/:type', 'admin.activity.Activity/recyclebin')->name('admin.activity.Activity.recyclebin');
        Route::resource('activity', 'admin.activity.Activity');

        // 拼团管理
        Route::post('groupon/addUser/:id', 'admin.activity.Groupon/addUser')->name('admin.activity.Groupon.addUser');
        Route::post('groupon/invalid/:id', 'admin.activity.Groupon/invalid')->name('admin.activity.Groupon.invalid');
        Route::resource('groupon', 'admin.activity.Groupon');
    })->middleware('check_rule', 'admin');
});